﻿/// <reference path="~/Scripts/Library/jquery-1.9.1.min.js" />

var postbackController = "Sponsor";

var postbackActionPrefix = "Sponsor";

function Entity_Validate() {

    var isValid = true;

    var lastResponseMessageLabel = $("#LastResponseMessageLabel");

    
    if (($("#Entity_Person:checked").length == 0) && ($("#Entity_Name").val () == "")) {

        LastResponseMessage_SetError("The Name must not be empty.");

        $("#Entity_Name_Label").addClass("ui-state-error");

        $("#PropertyTabs>ul>li").first().addClass("ui-state-error");

        isValid = false;

    }
        
    if (($("#Entity_Person:checked").length != 0) 
        
        && (($("#Entity_NameLast").val () == "") || ($("#Entity_NameFirst").val () == "")))  {
        
        LastResponseMessage_SetError("The Name must not be empty.");

        $("#Entity_Name_Label").addClass("ui-state-error");

        $("#PropertyTabs>ul>li").first().addClass("ui-state-error");

        isValid = false;

    }

    return isValid;

}

function Entity_OnReady() {



}
